<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title>系统管理后台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8" />

    <!--<link rel="icon" type="image/ico" href="http://tattek.com/minimal/assets/images/favicon.ico" />-->
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/static/admin/assets/css/vendor/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/admin/css/font-awesome.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/css/vendor/animate/animate.min.css">
    <link type="text/css" rel="stylesheet" media="all" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/mmenu/css/jquery.mmenu.all.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/videobackground/css/jquery.videobackground.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/css/vendor/bootstrap-checkbox.css">

    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/rickshaw/css/rickshaw.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/morris/css/morris.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/tabdrop/css/tabdrop.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/summernote/css/summernote.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/summernote/css/summernote-bs3.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/chosen/css/chosen.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/assets/js/vendor/chosen/css/chosen-bootstrap.css">

    <link href="${pageContext.request.contextPath}/static/admin/assets/css/minimal.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/admin/css/sweetalert.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <!--<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>-->
    <!--<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>-->
    <![endif]-->
</head>
<body class="bg-1">



<!-- Preloader -->
<div class="mask"><div id="loader"></div></div>
<!--/Preloader -->

<!-- Wrap all page content here -->
<div id="wrap">




    <!-- Make page fluid -->
    <div class="row">





        <!-- Fixed navbar -->
        <div class="navbar navbar-default navbar-fixed-top navbar-transparent-black mm-fixed-top" role="navigation" id="navbar">



            <!-- Branding -->
            <div class="navbar-header col-md-2">
                <a class="navbar-brand" href="index.html">
                    <strong>Shakes</strong>Beare
                </a>
                <div class="sidebar-collapse">
                    <a href="#">
                        <i class="fa fa-bars" style="line-height: 45px"></i>
                    </a>
                </div>
            </div>
            <!-- .nav-collapse -->
            <div class="navbar-collapse">
                <!-- Quick Actions -->
                <ul class="nav navbar-nav quick-actions">
                    <li class="dropdown divided">

                        <a class="dropdown-toggle button" data-toggle="dropdown" href="#">
                            <i class="fa fa-envelope"></i>
                            <span class="label label-transparent-black">1</span>
                        </a>

                        <ul class="dropdown-menu wider arrow nopadding messages">
                            <li><h1>You have <strong>1</strong> new message</h1></li>
                            <li>
                                <a class="cyan" href="#">
                                    <div class="profile-photo">
                                        <img src="${pageContext.request.contextPath}/static/admin/assets/images/ici-avatar.jpg" alt />
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">Ing. Imrich Kamarel</span>
                                        <span class="time">12 mins</span>
                                        <div class="message-content">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum</div>
                                    </div>
                                </a>
                            </li>

                            <li>
                                <a class="green" href="#">
                                    <div class="profile-photo">
                                        <img src="${pageContext.request.contextPath}/static/admin/assets/images/arnold-avatar.jpg" alt />
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">Arnold Karlsberg</span>
                                        <span class="time">1 hour</span>
                                        <div class="message-content">Lorem ipsum dolor sit amet, consectetur adipisicing elit</div>
                                    </div>
                                </a>
                            </li>

                            <li>
                                <a href="#">
                                    <div class="profile-photo">
                                        <img src="${pageContext.request.contextPath}/static/admin/assets/images/face.jpeg" alt />
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">John Douey</span>
                                        <span class="time">3 hours</span>
                                        <div class="message-content">Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia</div>
                                    </div>
                                </a>
                            </li>

                            <li>
                                <a class="red" href="#">
                                    <div class="profile-photo">
                                        <img src="${pageContext.request.contextPath}/static/admin/assets/images/peter-avatar.jpg" alt />
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">Peter Kay</span>
                                        <span class="time">5 hours</span>
                                        <div class="message-content">Ut enim ad minim veniam, quis nostrud exercitation</div>
                                    </div>
                                </a>
                            </li>

                            <li>
                                <a class="orange" href="#">
                                    <div class="profile-photo">
                                        <img src="${pageContext.request.contextPath}/static/admin/assets/images/george-avatar.jpg" alt />
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">George McCain</span>
                                        <span class="time">6 hours</span>
                                        <div class="message-content">Lorem ipsum dolor sit amet, consectetur adipisicing elit</div>
                                    </div>
                                </a>
                            </li>


                            <li class="topborder"><a href="#">Check all messages <i class="fa fa-angle-right"></i></a></li>
                        </ul>

                    </li>
                    <li class="dropdown divided user" id="current-user">
                        <div class="profile-photo">
                            <img src="${pageContext.request.contextPath}/static/admin/assets/images/face.jpeg" alt />
                        </div>
                        <a class="dropdown-toggle options" data-toggle="dropdown" href="#">
                            管理员 <i class="fa fa-caret-down"></i>
                        </a>

                        <ul class="dropdown-menu arrow settings">

                            <li>

                                <h3>Backgrounds:</h3>
                                <ul id="color-schemes">
                                    <li><a href="#" class="bg-1"></a></li>
                                    <li><a href="#" class="bg-2"></a></li>
                                    <li><a href="#" class="bg-3"></a></li>
                                    <li><a href="#" class="bg-4"></a></li>
                                    <li><a href="#" class="bg-5"></a></li>
                                    <li><a href="#" class="bg-6"></a></li>
                                </ul>

                                <div class="form-group videobg-check">
                                    <div class="col-xs-4 control-label">
                                        <div class="onoffswitch greensea small">
                                            <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="videobg-check">
                                        </div>
                                    </div>
                                </div>

                            </li>
                            <li class="divider"></li>
                            <li>
                                <a href="${pageContext.request.contextPath }/admin/setting/index.action"><i class="fa fa-user"></i>修改密码</a>
                            </li>
                            <li>
                                <a href="${pageContext.request.contextPath }/admin/logout.action"><i class="fa fa-power-off"></i> Logout</a>
                            </li>
                            <li></li>

                        </ul>
                    </li>


                </ul>
                <!-- /Quick Actions -->



                <!-- Sidebar -->
                <ul class="nav navbar-nav side-nav" id="sidebar">

                    <li class="collapsed-content">
                        <ul>
                            <li class="search"><!-- Collapsed search pasting here at 768px --></li>
                        </ul>
                    </li>

                    <li class="navigation" id="navigation">
                        <a href="#" class="sidebar-toggle" data-toggle="#navigation">Navigation <i class="fa fa-angle-up"></i></a>

                        <ul class="menu">

                            <li>
                                <a href="${pageContext.request.contextPath }/admin/index/index.action">
                                    <i class="fa fa-tachometer"></i> 概况
                                    <span class="badge badge-red"></span>
                                </a>
                            </li>
                            <li>
                                <a href="#">
                                    <i class="fa fa-tint"></i> 广告管理
                                </a>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-th-large"></i> 用户管理 <b class="fa fa-plus dropdown-plus"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/customer/index.action">
                                            <i class="fa fa-caret-right"></i> 用户管理
                                        </a>
                                    </li>
                                    <li>
                                        <a href="${pageContext.request.contextPath}/admin/customer/resumeIndex.action">
                                            <i class="fa fa-caret-right"></i> 简历管理
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-th-large"></i> 企业管理 <b class="fa fa-plus dropdown-plus"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="${pageContext.request.contextPath }/admin/company/index.action">
                                            <i class="fa fa-caret-right"></i> 企业用户账号
                                        </a>
                                    </li>
                                    <li>
                                        <a href="${pageContext.request.contextPath }/admin/company/verify.action">
                                            <i class="fa fa-caret-right"></i> 企业账号审核
                                        </a>
                                    </li>
                                </ul>
                            </li>

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                    <i class="fa fa-child"></i> 职位管理 <b class="fa fa-plus dropdown-plus"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="${pageContext.request.contextPath }/admin/job/index.action">
                                            <i class="fa fa-caret-right"></i> 职位列表
                                        </a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                </ul>
                <!-- Sidebar end -->





            </div>
            <!--/.nav-collapse -->





        </div>
        <!-- Fixed navbar end -->






        <!-- Page content -->
        <div id="content" class="col-md-12">









            <!-- page header -->
            <div class="pageheader">
                <h2><i class="fa fa-gear"></i> 修改密码
                </h2>
            </div>
            <!-- /page header -->






            <!-- content main container -->

            <div class="main">

                <!--具体功能框架写在这里-->
                <div class="col-md-12" >

                    <div class="">



                        <!-- tile -->

                        <section class="tile color transparent-black">



                            <!-- tile header -->
                            <div class="tile-header">
                                <h1><strong>修改密码</strong></h1>
                            </div>
                            <!-- /tile header -->

                            <!-- tile body -->
                            <div class="tile-body">

                                <form class="form-horizontal" role="form" parsley-validate id="numbervalidations">

                                    <div class="form-group">
                                        <label  for="old_psw" class=" control-label col-sm-2" style="margin-top: 8px">旧密码*</label>
                                        <div class="col-sm-8" >
                                            <input style="height: 50px" type="password" class="form-control" id="old_psw" parsley-trigger="change" parsley-required="true" parsley-type="number" parsley-min="6" parsley-validation-minlength="0" placeholder="输入你的旧密码" onblur="hide_msg(0)">
                                        </div>
                                        <p style="color:red;margin-top: 15px;visibility: hidden" class="col-sm-2" id="old_msg"></p>
                                    </div>

                                    <div class="form-group" style="margin-top: 50px">
                                        <label for="new_psw" class=" control-label col-sm-2" style="margin-top: 8px">新密码*</label>
                                        <div class="col-sm-8">
                                            <input style="height: 50px" type="password" class="form-control" id="new_psw" parsley-trigger="change" parsley-required="true" parsley-type="number" parsley-min="6" parsley-validation-minlength="0" placeholder="输入你的新密码" onblur="hide_msg(1)">
                                        </div>
                                        <p style="color:red;margin-top: 15px;visibility: hidden" class="col-sm-2" id="new_msg"></p>
                                    </div>

                                    <div class="form-group" style="margin-top: 50px">
                                        <label for="confirm_psw" class=" control-label col-sm-2" style="margin-top: 8px">确认密码*</label>
                                        <div class="col-sm-8">
                                            <input style="height: 50px" type="password" class="form-control" id="confirm_psw" parsley-trigger="change" parsley-required="true" parsley-type="number" parsley-min="6" parsley-validation-minlength="0" placeholder="再次输入你的新密码" onblur="hide_msg(2)">
                                        </div>
                                        <p style="color:red;margin-top: 15px;visibility: hidden" class="col-sm-2" id="confirm_msg"></p>
                                    </div>

                                    <div class="form-group form-footer footer-black-transparent" style="margin-top: 50px">
                                        <div class="">
                                            <div class="col-sm-6" style="text-align: center">
                                                <a style="width: 100px" class="btn btn-default" href="javascript:change_psw()">提交</a>
                                            </div>
                                            <div class="col-sm-6" style="text-align: center">
                                                <a style="width:100px" type="reset" class="btn btn-default" href="javascript:window.history.back()">取消</a>
                                            </div>
                                        </div>
                                    </div>

                                </form>

                            </div>
                            <!-- /tile body -->




                        </section>
                        <!-- /tile -->




                    </div>

                </div>
            </div>
            <!-- /content container -->

        </div>
        <!-- Page content end -->


    </div>
    <!-- Make page fluid-->




</div>
<!-- Wrap all page content end -->



<section class="videocontent" id="video"></section>



<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="${pageContext.request.contextPath}/static/admin/assets/js/jquery.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/mmenu/js/jquery.mmenu.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/sparkline/jquery.sparkline.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/nicescroll/jquery.nicescroll.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/animate-numbers/jquery.animateNumbers.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/videobackground/jquery.videobackground.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/blockui/jquery.blockUI.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/flot/jquery.flot.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/flot/jquery.flot.time.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/flot/jquery.flot.selection.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/flot/jquery.flot.animator.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/flot/jquery.flot.orderBars.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/easypiechart/jquery.easypiechart.min.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/rickshaw/raphael-min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/rickshaw/d3.v2.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/rickshaw/rickshaw.min.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/morris/morris.min.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/tabdrop/bootstrap-tabdrop.min.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/summernote/summernote.min.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/vendor/chosen/chosen.jquery.min.js"></script>

<script src="${pageContext.request.contextPath}/static/admin/assets/js/minimal.min.js"></script>
<script src="${pageContext.request.contextPath}/static/admin/js/sweetalert.min.js"></script>

<script>
    $(function(){

        // Initialize card flip
        $('.card.hover').hover(function(){
            $(this).addClass('flip');
        },function(){
            $(this).removeClass('flip');
        });

        // Initialize flot chart
        var d1 =[ [1, 715],
            [2, 985],
            [3, 1525],
            [4, 1254],
            [5, 1861],
            [6, 2621],
            [7, 1987],
            [8, 2136],
            [9, 2364],
            [10, 2851],
            [11, 1546],
            [12, 2541]
        ];
        var d2 =[ [1, 463],
            [2, 578],
            [3, 327],
            [4, 984],
            [5, 1268],
            [6, 1684],
            [7, 1425],
            [8, 1233],
            [9, 1354],
            [10, 1200],
            [11, 1260],
            [12, 1320]
        ];
        var months = ["January", "February", "March", "April", "May", "Juny", "July", "August", "September", "October", "November", "December"];

        // flot chart generate
        var plot = $.plotAnimator($("#statistics-chart"),
                [
                    {
                        label: 'Sales',
                        data: d1,
                        lines: {lineWidth:3},
                        shadowSize:0,
                        color: '#ffffff'
                    },
                    { label: "Visits",
                        data: d2,
                        animator: {steps: 99, duration: 500, start:200, direction: "right"},
                        lines: {
                            fill: .15,
                            lineWidth: 0
                        },
                        color:['#ffffff']
                    },{
                    label: 'Sales',
                    data: d1,
                    points: { show: true, fill: true, radius:6,fillColor:"rgba(0,0,0,.5)",lineWidth:2 },
                    color: '#fff',
                    shadowSize:0
                },
                    { label: "Visits",
                        data: d2,
                        points: { show: true, fill: true, radius:6,fillColor:"rgba(255,255,255,.2)",lineWidth:2 },
                        color: '#fff',
                        shadowSize:0
                    }
                ],{

                    xaxis: {

                        tickLength: 0,
                        tickDecimals: 0,
                        min:1,
                        ticks: [[1,"JAN"], [2, "FEB"], [3, "MAR"], [4, "APR"], [5, "MAY"], [6, "JUN"], [7, "JUL"], [8, "AUG"], [9, "SEP"], [10, "OCT"], [11, "NOV"], [12, "DEC"]],

                        font :{
                            lineHeight: 24,
                            weight: "300",
                            color: "#ffffff",
                            size: 14
                        }
                    },

                    yaxis: {
                        ticks: 4,
                        tickDecimals: 0,
                        tickColor: "rgba(255,255,255,.3)",

                        font :{
                            lineHeight: 13,
                            weight: "300",
                            color: "#ffffff"
                        }
                    },

                    grid: {
                        borderWidth: {
                            top: 0,
                            right: 0,
                            bottom: 1,
                            left: 1
                        },
                        borderColor: 'rgba(255,255,255,.3)',
                        margin:0,
                        minBorderMargin:0,
                        labelMargin:20,
                        hoverable: true,
                        clickable: true,
                        mouseActiveRadius:6
                    },

                    legend: { show: false}
                });

        $(window).resize(function() {
            // redraw the graph in the correctly sized div
            plot.resize();
            plot.setupGrid();
            plot.draw();
        });

        $('#mmenu').on(
                "opened.mm",
                function()
                {
                    // redraw the graph in the correctly sized div
                    plot.resize();
                    plot.setupGrid();
                    plot.draw();
                }
        );

        $('#mmenu').on(
                "closed.mm",
                function()
                {
                    // redraw the graph in the correctly sized div
                    plot.resize();
                    plot.setupGrid();
                    plot.draw();
                }
        );

        // tooltips showing
        $("#statistics-chart").bind("plothover", function (event, pos, item) {
            if (item) {
                var x = item.datapoint[0],
                        y = item.datapoint[1];

                $("#tooltip").html('<h1 style="color: #418bca">' + months[x - 1] + '</h1>' + '<strong>' + y + '</strong>' + ' ' + item.series.label)
                        .css({top: item.pageY-30, left: item.pageX+5})
                        .fadeIn(200);
            } else {
                $("#tooltip").hide();
            }
        });


        //tooltips options
        $("<div id='tooltip'></div>").css({
            position: "absolute",
            //display: "none",
            padding: "10px 20px",
            "background-color": "#ffffff",
            "z-index":"99999"
        }).appendTo("body");

        //generate actual pie charts
        $('.pie-chart').easyPieChart();


        //server load rickshaw chart
        var graph;

        var seriesData = [ [], []];
        var random = new Rickshaw.Fixtures.RandomData(50);

        for (var i = 0; i < 50; i++) {
            random.addData(seriesData);
        }

        graph = new Rickshaw.Graph( {
            element: document.querySelector("#serverload-chart"),
            height: 150,
            renderer: 'area',
            series: [
                {
                    data: seriesData[0],
                    color: '#6e6e6e',
                    name:'File Server'
                },{
                    data: seriesData[1],
                    color: '#fff',
                    name:'Mail Server'
                }
            ]
        } );

        var hoverDetail = new Rickshaw.Graph.HoverDetail( {
            graph: graph,
        });

        setInterval( function() {
            random.removeData(seriesData);
            random.addData(seriesData);
            graph.update();

        },1000);

        // Morris donut chart
        Morris.Donut({
            element: 'browser-usage',
            data: [
                {label: "Chrome", value: 25},
                {label: "Safari", value: 20},
                {label: "Firefox", value: 15},
                {label: "Opera", value: 5},
                {label: "Internet Explorer", value: 10},
                {label: "Other", value: 25}
            ],
            colors: ['#00a3d8', '#2fbbe8', '#72cae7', '#d9544f', '#ffc100', '#1693A5']
        });

        $('#browser-usage').find("path[stroke='#ffffff']").attr('stroke', 'rgba(0,0,0,0)');

        //sparkline charts
        $('#projectbar1').sparkline('html', {type: 'bar', barColor: '#22beef', barWidth: 4, height: 20});
        $('#projectbar2').sparkline('html', {type: 'bar', barColor: '#cd97eb', barWidth: 4, height: 20});
        $('#projectbar3').sparkline('html', {type: 'bar', barColor: '#a2d200', barWidth: 4, height: 20});
        $('#projectbar4').sparkline('html', {type: 'bar', barColor: '#ffc100', barWidth: 4, height: 20});
        $('#projectbar5').sparkline('html', {type: 'bar', barColor: '#ff4a43', barWidth: 4, height: 20});
        $('#projectbar6').sparkline('html', {type: 'bar', barColor: '#a2d200', barWidth: 4, height: 20});

        // sortable table
        $('.table.table-sortable th.sortable').click(function() {
            var o = $(this).hasClass('sort-asc') ? 'sort-desc' : 'sort-asc';
            $('th.sortable').removeClass('sort-asc').removeClass('sort-desc');
            $(this).addClass(o);
        });

        //todo's
        $('#todolist li label').click(function() {
            $(this).toggleClass('done');
        });

        // Initialize tabDrop
        $('.tabdrop').tabdrop({text: '<i class="fa fa-th-list"></i>'});

        //load wysiwyg editor
        $('#quick-message-content').summernote({
            toolbar: [
                //['style', ['style']], // no style button
                ['style', ['bold', 'italic', 'underline', 'clear']],
                ['fontsize', ['fontsize']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['height', ['height']],
                //['insert', ['picture', 'link']], // no insert buttons
                //['table', ['table']], // no table button
                //['help', ['help']] //no help button
            ],
            height: 143   //set editable area's height
        });

        //multiselect input
        $(".chosen-select").chosen({disable_search_threshold: 10});

    })

</script>
<script>
    function hide_msg(type){
        if(type == 0){
            $("#old_msg").css("visibility","hidden");
        }else  if(type == 1){
            $("#new_msg").css("visibility","hidden");
        }else{
            $("#confirm_msg").css("visibility","hidden");
        }
    }

    function change_psw(){
        var old_psw = $("#old_psw").val();
        var new_psw = $("#new_psw").val();
        var confirm_psw = $("#confirm_psw").val();
        if(old_psw == ""){
            $("#old_msg").css("visibility","visible");
            $("#old_msg").html("请填写旧密码！");
            return;
        }
        if(new_psw == "") {
            $("#new_msg").css("visibility", "visible");
            $("#new_msg").html("请填写新密码！");
            return;
        }
        if(confirm_psw == ""){
            $("#confirm_msg").css("visibility", "visible");
            $("#confirm_msg").html("请再次输入密码！");
            return;
        }
        if(new_psw.length < 6 || new_psw.length > 20){
            $("#new_msg").css("visibility", "visible");
            $("#new_msg").html("请输入6~20位密码！");
            return;
        }
        if(confirm_psw.length < 6 || confirm_psw.length > 20){
            $("#confirm_msg").css("visibility", "visible");
            $("#confirm_msg").html("请输入6~20位密码！");
            return;
        }
        if(new_psw != confirm_psw){
            $("#confirm_msg").css("visibility", "visible");
            $("#confirm_msg").html("两次密码输入不一致！");
            return;
        }
        $.ajax({
            url: "${pageContext.request.contextPath}/admin/setting/change_psw.action",
            type:'post',
            data:'old_psw='+old_psw+'&new_psw='+new_psw+'&confirm_psw='+confirm_psw,
            success: function (json) {
                if(json == -1){
                    $("#old_msg").css("visibility","visible");
                    $("#old_msg").html("输入旧密码错误！");
                }else if(json == -2){
                    $("#confirm_msg").css("visibility", "visible");
                    $("#confirm_msg").html("两次密码输入不一致！");
                }else if(json == 0){
                    swal("", "服务器出错！", "error");
                }else if(json == 1){
                    swal({
                        title: "",
                        text: "修改成功,请重新登录!",
                        type: "success",
                        showCancelButton: false,
                        closeOnConfirm: true,
                        confirmButtonText: "确定"
                    }, function() {
                        window.location.href="${pageContext.request.contextPath }/admin/logout.action";
                    });
                }
            }
        });
    }
</script>
</body>
</html>


